﻿/****************************************************************
*   作者：qq918
*   创建时间：2017/12/20 13:53:09
*   描述说明：
*   Byte数组帮助类
*****************************************************************/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model
{
    public static class ByteHelper
    {

        /// <summary>
        /// 转换到16进制文本
        /// </summary>
        /// <param name="bytes"></param>
        /// <param name="format"></param>
        /// <returns></returns>
        public static string ToHex(this byte[] bytes)
        {
            StringBuilder stringBuilder = new StringBuilder();

            foreach (var b in bytes)
            {
                stringBuilder.Append(b.ToString("X2"));
            }
            return stringBuilder.ToString();
        }


    }
}
